Modern computers may function with a graphical processing unit (GPU) to efficiently and quickly compute images and graphics. GPUs may function with a graphics rendering engine, which typically comprises multiple specialized processing engines organized in a dataflow-style pipeline. GPUs may also function with significant local memory resources, which may include a frame buffer.
The processing power and speed GPUs provide allow fast, efficient computation of two dimensional (2D) and three dimensional (3D) graphics, such as for video games. Moreover, their capabilities find application in other fields for high speed analysis of high volume medical, technical and geographic imaging information and financial, statistical and scientific data and for mathematical processing.
GPUs function to render graphical features spatially in a display scene based on geometrically primitive 2D polygons such as triangles. More complex scene features such as 3D objects are rendered as connected combinations of the 2D primitives.
3D graphics present an illusion of depth with a 2D display. Based on a perspective related to a vantage point of a viewer of the scene or a capturer thereof such as a camera, the rendering engine determines whether a feature of an object in the scene is occluded or obstructed by a feature of another scene object. For example, an image may have a foreground object that partially covers a background object.
Each pixel of each primitive, and thus or each image object or feature, in a 3D scene corresponds to a planar spatial 2D horizontal, vertical location, such as an ‘x,y’ value in a Cartesian coordinate system. Further, each pixel has a depth related ‘z’ value. A GPU may thus sort each object by increasing distance from an apparent or virtual remote vanishing point in the scene.
Processing speed may be increased by z buffering, in which the z value is stored in a depth buffer (z buffer) in association with each pixel on the surface of the objects in the image. The z values for pixels to be represented as closer to the vantage point are lower than the z values for pixels to be represented as farther therefrom, which are correspondingly higher.
In rendering graphics, each pixel is rasterized to determine coverage associated with each geometric primitive. Rasterizing may store (write) the z-value to and retrieve (read) the z-values from the Z-Buffer. However, latency may be reduced and resources conserved, e.g., in rasterizing and/or expensive subsequent operations such as shading, by early culling of primitives with z-values known to be bad. Thus, rasterizing may keep a local, lazily updated, conservative approximation (e.g., an approximate but conservative representation) of the Z-Buffer for fast local reference to cull primitives with particular z-values for early discard. Similarly, it may also be advantageous for the same approximate Z buffer to communicate an unambiguous acceptance of render geometry, in order to save the work required to do more exact visibility testing later.
Storage resources such as memory allocated to the approximate instance of the depth buffer kept locally to rasterization functions are limited in relation to the actual Z-Buffer. For example, the Z-Buffer has sufficient storage resources to support a format corresponding to the high granularity active anti-aliasing sampling mode of the surfaces being processed. However, the rasterizing-local approximate instance of the Z-Buffer may only have storage resources that suffice to support a pixel based granularity, which may be more coarse-grained than the finer-grained anti-aliasing sampling granularity.
At higher level anti-aliasing sample settings, the sample-based granularity of conventional z-culling updates (e.g., from a z-raster operations function) may exceed a constraint on the buffer, with which the lazy updates to the local Z-Buffer approximation may be stored. The extra data that correspond to the higher granularity anti-aliasing samples are thus discarded, which wastes the data and the resources with which it was gathered and processed earlier. At low level anti-aliasing settings on the other hand, the granularity of a conventional z-culling update to the local Z-Buffer approximation is coarser than the capacity that may be accommodated by the local buffer. This can reduce the fidelity of the compression that could otherwise be attained.
Approaches described in this section could, but have not necessarily been conceived or pursued previously. Unless otherwise indicated, neither approaches described in this section, nor issues identified in relation thereto are to be assumed as recognized in any prior art merely by inclusion therein.